# class Goods:
#     def __init__(self,name):
#         self.name = '商品'
#
#     def __str__(self):
#         return {f'手机类'}
#
#     def fn(self):
#         print('商品类')
#
# class Phone(Goods):
#     def __init__(self,name):
#         self.name = 'phone'
#
#     def fn(self):
#         print('商品类')
#
# phone = Phone('大白')
#
# phone.fn()
#
#

class Goods:
    def __init__(self):
        self.name = '商品'

    def __str__(self):
        return self.name

    def fn(self):
        print('商品类')


# 定义⼿机类
class Phone(Goods):
    # 重写init⽅法
    def __init__(self):
        self.name = '⼿机'

    # 重写fn⽅法
    def fn(self):
        print('⼿机')


# 调⽤
phone = Phone()
print(phone)
print(dir(phone))



